package com.cicc.beergamevirtualsimulationsystem.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.cicc.beergamevirtualsimulationsystem.entity.RoomEntity;
import com.cicc.beergamevirtualsimulationsystem.model.roleBinding.RoleBindingReq;
import com.cicc.beergamevirtualsimulationsystem.model.room.dto.CreateRoomDto;
import com.cicc.beergamevirtualsimulationsystem.model.room.dto.QueryJoinRoomDto;
import com.cicc.beergamevirtualsimulationsystem.model.room.dto.QueryRoomDto;
import com.cicc.beergamevirtualsimulationsystem.model.room.dto.QueryRoomRecordDto;
import com.cicc.beergamevirtualsimulationsystem.model.room.req.CreateRoomReq;

import java.util.List;

/**
 * 房间业务接口层
 */
public interface RoomService extends IService<RoomEntity> {

    /**
     * 根据房间口令查询房间id
     *
     * @param command
     * @return
     */
    QueryRoomDto queryRoomByCommand(String command);

    /**
     * 创建房间
     *
     * @param createRoomReq
     * @return
     */
    CreateRoomDto createRoom(CreateRoomReq createRoomReq);

    /**
     * 开始游戏
     *
     * @param roomId
     * @param roleBindingReq
     */
    void startGame(String roomId,String masterId,List<RoleBindingReq> roleBindingReq);
    /**
     * 解散房间  修改房间状态为关闭
     */
    Boolean closeRoom(String roomId);
    /**
     * 解散房间  修改房间状态为关闭
     */
    Boolean closeRoom(List<String> roomId);


    /**
     * 查询是否存在已经参与的游戏
     * @return
     */
    QueryJoinRoomDto queryGame();

    /**
     * 用户游戏历史记录
     * @return
     */
    List<QueryRoomRecordDto> queryRoomRecord();

    /**
     * 查看房间状态
     */
    Integer queryRoomStatus(String roomId);

    /**
     * 再来一把
     * @param roomId
     * @return
     */
    CreateRoomDto playAgain(String roomId);
}
